Optimal. Leaf size=85 \[ -\frac{a^2 \cot ^3(c+d x)}{3 d}+\frac{a^2 \cot (c+d x)}{d}+a^2 x-\frac{2 a b \csc ^3(c+d x)}{3 d}+\frac{2 a b \csc (c+d x)}{d}-\frac{b^2 \cot ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.115351, antiderivative size = 85, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3886, 3473, 8, 2606, 2607, 30} \[ -\frac{a^2 \cot ^3(c+d x)}{3 d}+\frac{a^2 \cot (c+d x)}{d}+a^2 x-\frac{2 a b \csc ^3(c+d x)}{3 d}+\frac{2 a b \csc (c+d x)}{d}-\frac{b^2 \cot ^3(c+d x)}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3886
Rule 3473
Rule 8
Rule 2606
Rule 2607
Rule 30
Rubi steps
\begin{align*} \int \cot ^4(c+d x) (a+b \sec (c+d x))^2 \, dx &=\int \left (a^2 \cot ^4(c+d x)+2 a b \cot ^3(c+d x) \csc (c+d x)+b^2 \cot ^2(c+d x) \csc ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^4(c+d x) \, dx+(2 a b) \int \cot ^3(c+d x) \csc (c+d x) \, dx+b^2 \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx\\ &=-\frac{a^2 \cot ^3(c+d x)}{3 d}-a^2 \int \cot ^2(c+d x) \, dx-\frac{(2 a b) \operatorname{Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\csc (c+d x)\right )}{d}+\frac{b^2 \operatorname{Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac{a^2 \cot (c+d x)}{d}-\frac{a^2 \cot ^3(c+d x)}{3 d}-\frac{b^2 \cot ^3(c+d x)}{3 d}+\frac{2 a b \csc (c+d x)}{d}-\frac{2 a b \csc ^3(c+d x)}{3 d}+a^2 \int 1 \, dx\\ &=a^2 x+\frac{a^2 \cot (c+d x)}{d}-\frac{a^2 \cot ^3(c+d x)}{3 d}-\frac{b^2 \cot ^3(c+d x)}{3 d}+\frac{2 a b \csc (c+d x)}{d}-\frac{2 a b \csc ^3(c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.460439, size = 122, normalized size = 1.44 \[ -\frac{\csc ^3(c+d x) \left (-9 a^2 c \sin (c+d x)-9 a^2 d x \sin (c+d x)+3 a^2 c \sin (3 (c+d x))+3 a^2 d x \sin (3 (c+d x))+4 a^2 \cos (3 (c+d x))+12 a b \cos (2 (c+d x))-4 a b+3 b^2 \cos (c+d x)+b^2 \cos (3 (c+d x))\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.047, size = 111, normalized size = 1.3 \begin{align*}{\frac{1}{d} \left ({a}^{2} \left ( -{\frac{ \left ( \cot \left ( dx+c \right ) \right ) ^{3}}{3}}+\cot \left ( dx+c \right ) +dx+c \right ) +2\,ab \left ( -1/3\,{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{ \left ( \sin \left ( dx+c \right ) \right ) ^{3}}}+1/3\,{\frac{ \left ( \cos \left ( dx+c \right ) \right ) ^{4}}{\sin \left ( dx+c \right ) }}+1/3\, \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) \right ) -{\frac{{b}^{2} \left ( \cos \left ( dx+c \right ) \right ) ^{3}}{3\, \left ( \sin \left ( dx+c \right ) \right ) ^{3}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47951, size = 103, normalized size = 1.21 \begin{align*} \frac{{\left (3 \, d x + 3 \, c + \frac{3 \, \tan \left (d x + c\right )^{2} - 1}{\tan \left (d x + c\right )^{3}}\right )} a^{2} + \frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{2} - 1\right )} a b}{\sin \left (d x + c\right )^{3}} - \frac{b^{2}}{\tan \left (d x + c\right )^{3}}}{3 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.831908, size = 240, normalized size = 2.82 \begin{align*} \frac{6 \, a b \cos \left (d x + c\right )^{2} +{\left (4 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{3} - 3 \, a^{2} \cos \left (d x + c\right ) - 4 \, a b + 3 \,{\left (a^{2} d x \cos \left (d x + c\right )^{2} - a^{2} d x\right )} \sin \left (d x + c\right )}{3 \,{\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec{\left (c + d x \right )}\right )^{2} \cot ^{4}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.39209, size = 238, normalized size = 2.8 \begin{align*} \frac{a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} - 2 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 24 \,{\left (d x + c\right )} a^{2} - 15 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 18 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 3 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + \frac{15 \, a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 18 \, a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 3 \, b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - a^{2} - 2 \, a b - b^{2}}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3}}}{24 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]